<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const user = {
        name: "jack",
        age: 20,
        gender: "boy",
        [Symbol("allow")]: true,
      };
      // 复制
      const admin = {};
      for (let k in user) {
        admin[k] = user[k];
      }
      // admin.name = user.name;
      // admin.age = user.age;
      // admin.gender = user.gender;

      // test
      admin.age = 22;
      console.log("admin.age", admin.age); //22
      console.log("user.age", user.age); //20
    </script>
  </body>
</html>
